<?php

class Favoritos_M extends I_Model {

    protected $_table_name = 'favoritos';
    protected $_primary_key = 'ID';
    protected $_primary_filter = 'intval';
    protected $_order_by = 'ID';
    protected $_direction = 'DESC';
    public $rules = array();
    protected $_timestamps = FALSE;

    public function __construct() {
        parent::__construct();
    }
    

    function all_info($where){
          $this->db->select('lt.*,f.*,le.ID as COD_LEILAO, cm.NOME_FANTASIA AS CLIENTE')
                   ->from('favoritos as f')
                   ->join('lotes as lt','lt.ID=f.LOTE_ID')
                   ->join('leiloes as le','le.ID=lt.LEILAO_ID')
                   ->join('comitentes as cm','cm.ID=le.COMITENTE_ID')
                   ->where($where);

                 $q =  $this->db->get();
                 if($q->num_rows() > 0){
                     return  $q->result();
                 }
          return false;
    }
    
    
   

    

}
